package com.ruoyi.commodity.domain;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 商品订单子单对象 commodity_order_sub
 *
 * @author ruoyi
 * @date 2024-01-14
 */
@TableName("commodity_order_sub")
public class CommodityOrderSub implements Serializable
{
    private static final long serialVersionUID = 1L;

    /** $column.columnComment */
    @TableId(type = IdType.ASSIGN_ID)
    private String id;

    /** 商品id */
    @Excel(name = "商品id")
    private String cid;

    /** 订单id */
    @Excel(name = "订单id")
    private String fid;

    /** 商品名称 */
    @Excel(name = "商品名称")
    private String name;

    @Excel(name = "商品图片")
    private String picture;

    /** 数量 */
    @Excel(name = "数量")
    private Integer number;

    /** 价格 */
    @Excel(name = "价格")
    private BigDecimal price;

    /** 小计金额（实付金额） */
    @Excel(name = "小计金额", readConverterExp = "实付金额")
    private BigDecimal smallPrice;

    /** 总金额 */
    @Excel(name = "总金额")
    private BigDecimal totalPrice;

    /** 获得积分数 */
    @Excel(name = "获得积分数")
    private BigDecimal integral;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    public String getPicture() {
        return picture;
    }

    public void setPicture(String picture) {
        this.picture = picture;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public void setId(String id)
    {
        this.id = id;
    }

    public String getId()
    {
        return id;
    }
    public void setCid(String cid)
    {
        this.cid = cid;
    }

    public String getCid()
    {
        return cid;
    }
    public void setFid(String fid)
    {
        this.fid = fid;
    }

    public String getFid()
    {
        return fid;
    }
    public void setName(String name)
    {
        this.name = name;
    }

    public String getName()
    {
        return name;
    }
    public void setNumber(Integer number)
    {
        this.number = number;
    }

    public Integer getNumber()
    {
        return number;
    }
    public void setPrice(BigDecimal price)
    {
        this.price = price;
    }

    public BigDecimal getPrice()
    {
        return price;
    }
    public void setSmallPrice(BigDecimal smallPrice)
    {
        this.smallPrice = smallPrice;
    }

    public BigDecimal getSmallPrice()
    {
        return smallPrice;
    }
    public void setTotalPrice(BigDecimal totalPrice)
    {
        this.totalPrice = totalPrice;
    }

    public BigDecimal getTotalPrice()
    {
        return totalPrice;
    }
    public void setIntegral(BigDecimal integral)
    {
        this.integral = integral;
    }

    public BigDecimal getIntegral()
    {
        return integral;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("cid", getCid())
            .append("fid", getFid())
            .append("name", getName())
            .append("number", getNumber())
            .append("price", getPrice())
            .append("createTime", getCreateTime())
            .append("smallPrice", getSmallPrice())
            .append("totalPrice", getTotalPrice())
            .append("integral", getIntegral())
            .toString();
    }
}
